package com.sphd.beautysalon.presenter;


import com.android.volley.VolleyError;
import com.sphd.beautysalon.info.RestaurantInfo;
import com.sphd.beautysalon.model.JifenModelImpl;
import com.sphd.beautysalon.view.JifenView;

/**
* Created by Hu on 2016/12/21
*/

public class JifenPresenterImpl implements JifenPresenter {
    JifenModelImpl jifenModel;
    JifenView jifenView;

    public JifenPresenterImpl(JifenView jifenView) {
        this.jifenView = jifenView;
        jifenModel=new JifenModelImpl();
    }

    @Override
    public void addData(String url) {

    }

    @Override
    public void sendError(VolleyError error) {
            jifenView.dissLoading();
    }

    @Override
    public void getResInfo(String url) {
        jifenView.showLoading();
        jifenModel.sendUrl(url,this);
    }

    @Override
    public void sendResInfo(RestaurantInfo restaurantInfo) {
        jifenView.recResInfo(restaurantInfo);
        jifenView.dissLoading();
    }

    @Override
    public void setUrl(String url) {
        jifenModel.setUrl(url,this);
    }

    @Override
    public void recRes(int res) {
        jifenView.recRes(res);
        jifenView.dissLoading();
    }
}